#include <bits/stdc++.h>
using namespace std;
map<int,int>a;
vector<int>b;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    long long n,ans;
    cin>>n;
    ans=n;
    for(int i=0;i<n;i++){
        int x;
        cin>>x;
        a[x]++;
    }
    for(auto c:a){
        if(c.second!=0)b.push_back(c.second);
    }
    for(int i=0;i<b.size()-1;i++){
        ans-=min(b[i],b[i+1]);
    }
    cout<<ans;
    return 0;
}
